package com.example.coinhelper.Bean;

import com.example.coinhelper.R;
import com.example.coinhelper.utils.TimeUtility;

import java.text.SimpleDateFormat;
import java.util.Date;

public class User {
    private String username;
    private String password;
    private String name;
    private int icon;
    private String gender;
    private String registrationTime;
    private String signature;
    private double money;

    public User() {

    }

    // 构造函数
    public User(String username, String password, String name, int icon, String gender, String registrationTime, String signature) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.icon = icon;
        this.gender = gender;
        this.registrationTime = registrationTime;
        this.signature = signature;
    }

    public User(String username, String password) {
        this.username = username;
        this.password = password;
        this.money = 0.0;
        // 将 formattedDateTime 设置为 registrationTime
        this.registrationTime = TimeUtility.getCurrentLocalTime();
        name = "";
        icon = R.mipmap.author;
        gender = "";
        signature = "";

    }

    // Getter 和 Setter 方法
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIcon() {
        return icon;
    }

    public void setIcon(int icon) {
        this.icon = icon;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getRegistrationTime() {
        return registrationTime;
    }

    public void setRegistrationTime(String registrationTime) {
        this.registrationTime = registrationTime;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getSignature() {
        return signature;
    }

    @Override
    public String toString() {
        return "User{" + "username='" + username + '\'' + ", password='" + password + '\'' + ", name='" + name + '\'' + ", icon='" + icon + '\'' + ", gender='" + gender + '\'' + ", registrationTime='" + registrationTime + '\'' + ", signature='" + signature + '\'' + '}';
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }
}


